function Firework(x, y, bomb, alive, r, g, b) {
    this.pos = createVector(x, y);
    this.r = r;
    this.g = g;
    this.b = b;

    if (bomb) {
        this.vel = createVector(0, random(-12, -8));
    } else {
        this.vel = p5.Vector.random2D();
        this.vel.mult(random(2, 10))
    }

    this.acc = createVector(0, 0);
    this.alive = alive;

    this.applyForce = function (force) {
        this.acc.add(force);
    };

    this.update = function () {
        if (!this.alive) {
            this.vel.mult(0.95);
            if(this.r > 0){
                this.r -= 5;
            }
            if(this.g > 0){
                this.g -= 5;
            }
            if(this.b > 0){
                this.b -= 5;
            }
        }
        this.vel.add(this.acc);
        this.pos.add(this.vel);
        this.acc.mult(0);
    };

    this.show = function () {
        if (!bomb) {
            strokeWeight(random(3, 10));
            stroke(this.r, this.g, this.b);
        } else {
            strokeWeight(4);
            stroke(255);
        }
        point(this.pos.x, this.pos.y);
    }
}